/*----------------------------------------------------------------------------*/
/* Team 3647
/* Tower.java
/*
/* Ball Lift controls
/* Ball Stop
/*----------------------------------------------------------------------------*/
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Victor;

public class Tower {

    public static final Victor TowerLift = new Victor(8);
    private static final Solenoid TurretStop = new Solenoid(4);
    private static final Solenoid TurretFree = new Solenoid(3);

    public static void BallLift() {
        double speed = .4;
        /*
        if (DriveBase.Stick1.getRawButton(6) || !PSoC.getDigital(6)) 
            TowerLift.set(speed);
        else if (DriveBase.Stick1.getRawButton(5) || !PSoC.getDigital(8)) 
            TowerLift.set(-speed);
        else 
            TowerLift.set(0);    
        */
        
        if (DriveBase.Stick1.getRawButton(6)) {
            TowerLift.set(speed);
        } else if (DriveBase.Stick1.getRawButton(5)) {
            TowerLift.set(-speed);
        } else {
            TowerLift.set(0);
        }
    }

    public static void BallStop() {
        if (!PSoC.getDigital(7))
            TowerBlocked();
        else 
            TowerFree();
    }

    public static void TowerBlocked() {
        TurretStop.set(true);
        TurretFree.set(false);
    }

    public static void TowerFree() {
        TurretStop.set(false);
        TurretFree.set(true);
    }
}